package org.dromara.bean.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import org.dromara.bean.domain.HisMemberAddress;
import org.dromara.bean.mapper.BaseMemberAddressMapper;
import org.dromara.bean.service.IBaseMemberAddressService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author wangtao
 * @since 2022-06-09
 */
@Service
public class BaseMemberAddressServiceImpl extends ServiceImpl<BaseMemberAddressMapper, HisMemberAddress> implements IBaseMemberAddressService {

    @Override
    public void removeDefault(String memberId) {
        this.update(new LambdaUpdateWrapper<HisMemberAddress>()
                .eq(HisMemberAddress::getMemberId, memberId)
                .set(HisMemberAddress::getIsDefault, 0));
    }
}
